﻿<%@ Page Language="C#" MasterPageFile="../../MasterPage.Master" AutoEventWireup="true" CodeBehind="ICM_Master_Committee_Position.aspx.cs" Inherits="KPIS.GERP.GIMS.APP.APP_UI.Form.ICM_Master_Committee_Position" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<%@ Register TagPrefix="custom" Namespace="KPIS.Customs.UI" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="server">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function RowDbClick(sender, eventArgs) {
                var hiddenElement = document.getElementById("<%= hdSeq.ClientID %>");
                hiddenElement.value = eventArgs.getDataKeyValue("Seq");
                $find("<%= RadManager1.ClientID %>").ajaxRequest(hiddenElement.value);
            }

            function SeqClick(seq) {
                var hiddenElement = document.getElementById("<%= hdSeq.ClientID %>");
                hiddenElement.value = seq;
                $find("<%= RadManager1.ClientID %>").ajaxRequest(seq);
            }

            function ExpandPersonal(sender, Args) {
                if (!sender._loaded) {
                    $find("<%=RadAjaxPanel1.ClientID %>").ajaxRequest();
                    sender._loaded = true;
                }
            }
        </script>
    </telerik:RadCodeBlock>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" BackgroundPosition="None" Skin="Outlook">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxManager runat="server" ID="RadManager1" OnAjaxRequest="RadManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="panelData">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="panelCommand" />
                    <telerik:AjaxUpdatedControl ControlID="panelData" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="panelCommand">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="panelCommand" />
                    <telerik:AjaxUpdatedControl ControlID="panelData" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    
    <asp:Panel ID="panelHidden" runat="server">
        <asp:HiddenField ID="hdSeq" runat="server" Value="" />
    </asp:Panel>

    <telerik:RadSplitter id="RadSplitter1" runat="server" height="460" width="1000" Skin="Office2007">
        <telerik:RadPane id="LeftPane" runat="server" width="22" Scrolling="None" Locked="true">
            <telerik:RadSlidingZone id="SlidingZone1" runat="server" width="22" ClickToOpen="true">
                <telerik:RadSlidingPane id="PanePersonal" title="ข้อมูลส่วนตัว" runat="server" width="265" IconUrl="../Image/General/user.gif" EnableDock="false" OnClientBeforeExpand="ExpandPersonal">
                    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" OnAjaxRequest="OnAjaxRequest">
                    </telerik:RadAjaxPanel>
                </telerik:RadSlidingPane>
            </telerik:RadSlidingZone>
        </telerik:RadPane>
        <telerik:RadSplitBar id="RadSplitBar1" runat="server"></telerik:RadSplitBar>
        <telerik:RadPane id="PaneData" runat="server" Scrolling="None">
	    <table width="100%" cellpadding="0" cellspacing="0">
            <tr>
                <td>
                    <asp:Panel ID="panelCommand" runat="server">
                        <div class="bigModulePaneFull">
                            <div class="bigModuleBottomPaneFull">
                                <table cellpadding="0" cellspacing="0">
                                    <tr class="command-list">
                                        <td class="command-item" style="border: none">
                                            <asp:LinkButton ID="ShowGrid" runat="server" CssClass="LinkButton" onclick="ShowGrid_Click" CausesValidation="false">
                                                <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/table.gif" />&nbsp;&nbsp;แสดงข้อมูลทั้งหมด
                                            </asp:LinkButton>                        
                                        </td>
                                        <td class="command-item">
                                            <asp:LinkButton ID="AddNew" runat="server" CssClass="LinkButton" onclick="AddNew_Click">
                                                <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/AddRecord.gif" />&nbsp;&nbsp;เพิ่มข้อมูลใหม่
                                            </asp:LinkButton>
                                        </td>
                                        <td class="command-item">
                                            <asp:LinkButton ID="Edit" runat="server" CssClass="LinkButton"  visible="false" OnClick="Edit_Click">
                                                <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/Edit.gif" />&nbsp;&nbsp;แก้ไขข้อมูล
                                            </asp:LinkButton>
                                        </td>
                                        <td class="command-item">
                                            <asp:LinkButton ID="Delete" runat="server" CssClass="LinkButton" OnClientClick="javascript:return confirm('ยืนยันการลบข้อมูลที่เลือก')" OnClick="Delete_Click">
                                                <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/Delete.gif" />&nbsp;&nbsp;ลบข้อมูล
                                            </asp:LinkButton>
                                        </td>
                                        <td class="command-item">
                                            <asp:LinkButton ID="AddNewSave" runat="server" CssClass="LinkButton" Visible="false" onclick="AddNewSave_Click">
                                                <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/Cmd_Save.gif" />&nbsp;&nbsp;บันทึกข้อมูล
                                            </asp:LinkButton>
                                        </td>
                                        <td class="command-item">
                                            <asp:LinkButton ID="EditSave" runat="server" CssClass="LinkButton" Visible="false" onclick="EditSave_Click">
                                                <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/Cmd_Save.gif" />&nbsp;&nbsp;บันทึกข้อมูล
                                            </asp:LinkButton>
                                        </td>
                                        <td class="command-item">
                                            <asp:LinkButton ID="Cancel" runat="server" CssClass="LinkButton" Visible="false" onclick="Cancel_Click">
                                                <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/Cancel.gif" />&nbsp;&nbsp;ยกเลิก
                                            </asp:LinkButton>
                                        </td>
                                        <td class="command-item">
                                            <asp:LinkButton ID="Help" runat="server" CssClass="LinkButton" Visible="false" CausesValidation="false">
                                                <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Tree/help3.gif" />&nbsp;&nbsp;ช่วยเหลือ
                                            </asp:LinkButton>
                                        </td>
                                        <td class="command-item">
                                            <asp:LinkButton ID="Recycle" runat="server" CssClass="LinkButton" Visible="true" 
                                                OnClientClick="javascript:radopen('../Delete_Form/ICM_Master_Resource_Type.aspx', 'WindowDelete');">
                                                <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/Refresh.gif" width="14" height="14"/>&nbsp;&nbsp;กู้ข้อมูล
                                            </asp:LinkButton>
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </div> 
                        <telerik:RadToolTip runat="server" ID="RadToolTip1" Width="300px" Height="70px" TargetControlID="Help" ShowEvent="OnClick"
                        IsClientID="false" Animation="Fade" HideEvent="LeaveToolTip" Position="BottomCenter" Skin="Outlook">
                            <table width="100%">
                                <tr class="table-outlook-header">
                                    <td>
                                        <asp:Label ID="lblTipHeader" runat="server" Text="ความสำคัญ" Font-Size="Small" ForeColor="White" Font-Bold="true"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <asp:Label ID="Detail" runat="server" Font-Size="Small" 
                                        Text="<b>หน่วยนับ</b> ใช้ประกอบกับการจำแนกพัสดุ เพื่อใช้เป็นตัวแปรควบคุมสำหรับกระบวนการจัดหาพัสดุ และกระบวนการควบคุมพัสดุ">
                                        </asp:Label>
                                    </td>
                                </tr>
                            </table>
                        </telerik:RadToolTip>   
                    </asp:Panel>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Panel ID="panelData" runat="server">
                        <div class="bigModulePaneFull">
                            <div class="bigModuleBottomPaneFull">
                                <asp:Panel ID="panelHeaderList" runat="server">
                                    <div class="header-grid">
                                        <asp:Label ID="lblHeaderList" runat="server" Text="ตำแหน่งในคณะกรรมการ"></asp:Label>
                                    </div>
                                </asp:Panel>
                                <asp:Panel CssClass="panelList" runat="server" ID="panelList" ScrollBars="Auto">
                                    <ul class="formList" id="Ul1">  
                                        <div class="formList-detail">
                                            <table>
                                                <tr>
                                                    <td width = "150px">
                                                        ตำแหน่งในคณะกรรมการ :
                                                    </td>
                                                    <td>
                                                        <asp:Label runat="server" ID="lblName" AssociatedControlID="txtName"></asp:Label>
                                                        <asp:TextBox CssClass="TextBox" ID="txtName" runat="server" Visible="false" Width="300px"></asp:TextBox>
                                                        <label id="Label2" runat="server"><font color="red">*</font></label>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                    </td>
                                                    <td>
                                                        <asp:RequiredFieldValidator ID="ValtxtName" runat="server" ControlToValidate="txtName" SetFocusOnError="True" Display="Dynamic" ErrorMessage="* กรุณาระบุตำแหน่งในคณะกรรมการ *"></asp:RequiredFieldValidator>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>         
                                        <div class="formList-detail">
                                            <table>
                                                <tr>
                                                    <td width = "150px" valign="top">
                                                        รายละเอียด :
                                                    </td>
                                                    <td>
                                                        <asp:Label runat="server" ID="lblDescr" AssociatedControlID="txtDescr"></asp:Label>
                                                        <asp:TextBox CssClass="TextBox" ID="txtDescr" runat="server" Visible="false" TextMode="MultiLine" Height="100" Width="300px" Font-Names="Microsoft Sans Serif"></asp:TextBox>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    </ul>
                                </asp:Panel>
                                <asp:Panel CssClass="panelGrid" ID="panelGrid" runat="server" ScrollBars="Auto" Visible="true">
                                    <div align="center">
                                        <telerik:RadGrid CssClass="RadGrid" ID="Grid" runat="server" AllowFilteringByColumn="true"
                                        AllowMultiRowSelection="True" AllowPaging="True" AllowSorting="True"
                                        AutoGenerateColumns="False" EnableAJAX="True" PageSize="8"
                                        GridLines="None" ShowStatusBar="false" Skin="Outlook" Width="95%"
                                        OnItemCommand="Grid_ItemCommand">
                                            <MasterTableView AllowMultiColumnSorting="true" DataKeyNames="Seq" ClientDataKeyNames="Seq" Width="100%">
                                                <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                                                <Columns>
                                                    <custom:CustomClientSelectColumn UniqueName="ClientSelectColumn">
                                                        <HeaderStyle Width="20px" HorizontalAlign="Center" />
                                                        <ItemStyle HorizontalAlign="Center" />
                                                        <FilterTemplate> 
                                                            <asp:LinkButton ID="clearFilter" runat="server" ToolTip="ยกเลิกการค้นหา" OnClick="clearFilter_Click">
                                                                <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/Cancel.gif" />
                                                            </asp:LinkButton>
                                                        </FilterTemplate> 
                                                    </custom:CustomClientSelectColumn>
                                                    <telerik:GridTemplateColumn DataField="Name"  HeaderText="ตำแหน่งในคณะกรรมการ"
                                                        AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                        FilterControlWidth="100%" UniqueName="Name" SortExpression="Name">
                                                        <HeaderStyle HorizontalAlign="Center" Width="300px" />
                                                        <ItemStyle HorizontalAlign="Left" />
                                                        <ItemTemplate>
                                                            <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="#" onclick='<%# Eval("Seq","return SeqClick( {0} );") %>' Text='<%# Eval("Name") %>'></asp:HyperLink>
                                                        </ItemTemplate>
                                                    </telerik:GridTemplateColumn>
                                                    <telerik:GridBoundColumn DataField="Descr" 
                                                        AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
                                                        FilterControlWidth="100%"
                                                        HeaderStyle-HorizontalAlign="Center" HeaderText="รายละเอียด" 
                                                        UniqueName="Descr">
                                                        <HeaderStyle HorizontalAlign="Center" />
                                                        <ItemStyle HorizontalAlign="Left" />
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn DataField="Seq" 
                                                        HeaderStyle-HorizontalAlign="Center" UniqueName="Seq" 
                                                        Visible="false">
                                                        <HeaderStyle HorizontalAlign="Center" />
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn DataField="InfoRecord.InfoStatus.Status" 
                                                        HeaderStyle-HorizontalAlign="Center" UniqueName="InfoRecord.InfoStatus.Status" Visible="false">
                                                        <HeaderStyle HorizontalAlign="Center" />
                                                    </telerik:GridBoundColumn>
                                                </Columns>
                                            </MasterTableView>
                                            <ClientSettings EnableRowHoverStyle="true" >
                                                <Selecting AllowRowSelect="True" />
                                                <ClientEvents OnRowDblClick="RowDbClick" />
                                            </ClientSettings>
                                        </telerik:RadGrid>
                                    </div>
                                    <br />
                                </asp:Panel>
                            </div>
                        </div>
                    </asp:Panel>
                </td>
            </tr>
        </table>
        </telerik:RadPane>
    </telerik:RadSplitter>
</asp:Content>


